/**
 * HZWQ.com Inc.
 * Copyright（c）2013-2024 All Rights Reserved.
 */
package com.app.redis.config;

import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * @author zhangch
 * @version $Id: LocalDateConverter.JAVA, V 0.1 2024-10-14 19:52 zhangch
 */
@Component
@ConfigurationPropertiesBinding
public class LocalDateConverter implements Converter<String, LocalDate> {

    @Override
    public LocalDate convert(String date) {
        return LocalDate.parse(date, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
    }
}